html,
body {
  margin: 0;
  padding: 0;

  background-color: #f0f0f0;
}

main {
  max-width: 1500px;
  margin-left: auto;
  margin-right: auto;
}

:root {
  --basic-spacing: 15px;
  --card-border-width: 1px;
}

h1 {
  margin-top: 0;
}

a {
  color: #0468bf;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

a:visited {
  color: #05aff2;
}

.page {
  padding: calc(var(--basic-spacing) * 2);
  font-family: -apple-system, Roboto, sans-serif, serif;
}

p {
  margin: 0.5em 0;
}

.example-buttons {
  margin-bottom: 20px;
  margin-top: 20px;
  max-width: 500px;
}
.example-buttons button {
  margin-left: 5px;
}

.form-group {
  display: flex;
  align-items: center;
  margin: 0.5em 0;
}

.form-group label {
  display: block;
  width: 200px;
}

.form-group select,
.form-group input {
  display: block;
  box-shadow: 0 1px 3px rgb(0, 0, 0, 0.15);
  background-color: white;
}

.card {
  margin: var(--basic-spacing) 0;
  padding: var(--basic-spacing);

  display: flex;
  justify-content: space-between;

  border: var(--card-border-width) solid #ccc;
  border-bottom-color: #bbb;
  background-color: white;

  box-shadow: 0 3px 2px rgb(0, 0, 0, 0.05);
}

.card > figure {
  margin: 0;
  overflow: auto;
}

.no-screenshot {
  color: gray;
}

.card figure > img {
  display: block;
  cursor: pointer;
  height: auto;
  width: 100%;
  max-height: 400px;
  max-width: 400px;
}

.card .link {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

h3:first-child {
  margin-top: 0;
  margin-bottom: 0.5em;
}

.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.7);
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;

  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop img {
  background-color: white;
  max-width: 90%;
  max-height: 90%;
  border: 10px solid black;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

@media (min-width: 800px) {
  .card > div {
    min-width: max(400px, 30vw);
  }

  .card > figure {
    max-width: 500px;
    margin-left: var(--basic-spacing);
  }
}

@media (max-width: 800px) {
  .page {
    padding: var(--basic-spacing);
  }

  .card {
    flex-direction: column;
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  .card .link {
    max-width: calc(
      100vw - var(--basic-spacing) * 4 - var(--card-border-width) * 2
    );
  }

  .card > figure {
    max-width: 800px;
    max-height: 900px;
    margin-top: var(--basic-spacing);
    padding-top: var(--basic-spacing);
    border-top: 1px dashed #ccc;
    margin-left: 0;
  }

  .modal-backdrop {
    overflow: scroll;
    display: block;
  }

  .modal-backdrop img {
    max-width: 800px;
  }
}

/* from https://getflywheel.com/layout/sticky-back-to-top-button-tutorial/ */
.top-link {
  position: fixed;
  bottom: 0;
  right: 0;
  display: inline-flex;

  cursor: pointer;
  align-items: center;
  justify-content: center;
  margin: 0 1em 1em 0;
  border-radius: 50%;
  padding: 1em;
  width: 30px;
  height: 30px;
  background-color: #aaf;
}
